package com.flowplan.entity.enums;

/**
 * 待办类型枚举
 * 
 * @author FlowPlan Team
 */
public enum TodoType {
    /**
     * 沟通确认
     */
    COMMUNICATION("COMMUNICATION", "沟通确认"),
    
    /**
     * 排期安排
     */
    SCHEDULE("SCHEDULE", "排期安排"),
    
    /**
     * 文档编写
     */
    DOCUMENT("DOCUMENT", "文档编写"),
    
    /**
     * 数据源核查
     */
    DATA_SOURCE("DATA_SOURCE", "数据源核查"),
    
    /**
     * 开发实现
     */
    DEVELOP("DEVELOP", "开发实现"),
    
    /**
     * 测试验证
     */
    TEST("TEST", "测试验证"),
    
    /**
     * UAT验收
     */
    UAT("UAT", "UAT验收"),
    
    /**
     * 发布上线
     */
    RELEASE("RELEASE", "发布上线");
    
    private final String code;
    private final String description;
    
    TodoType(String code, String description) {
        this.code = code;
        this.description = description;
    }
    
    public String getCode() {
        return code;
    }
    
    public String getDescription() {
        return description;
    }
    
    /**
     * 根据代码获取枚举
     */
    public static TodoType fromCode(String code) {
        for (TodoType type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid todo type code: " + code);
    }
}